The invention relates to computer graphics and in particular to rendering of specular reflection from surface unevenness (xe2x80x9cbumpsxe2x80x9d).
xe2x80x9cBump mappingxe2x80x9d techniques are known for example from an article by Mark Peercy, John Airey and Brian Cabral, titled xe2x80x9cEfficient Bump Mapping Hardwarexe2x80x9d, published in the Siggraph proceedings 1997. This article will be referred to as xe2x80x9cPeercy et al.xe2x80x9d. In bump mapping one considers a predetermined two dimensional height field f(u,v) which is used to xe2x80x9cprojectxe2x80x9d bumps onto different surfaces. For each such surface in three dimensional space, a mapping is defined which assigns each point xe2x80x9crxe2x80x9d on the surface to a respective location (u,v) in the height field. The surface is considered to be displaced along its normal at the point xe2x80x9crxe2x80x9d by an amount equal to the value of the height field at the location assigned to that point xe2x80x9crxe2x80x9d.
When a computer graphics image of such a surface is generated this leads to variations in reflections from the surface. For a realistic effect, it is highly desirable to account for specular reflections (mirror-like reflections) from the bumps. This leads to sharply defined intensity maxima (xe2x80x9chighlightsxe2x80x9d).
The basic idea of bump mapping is that only the effect of bumps on local surface orientation is used to compute the appearance of the surface, as far as it affects diffuse and/or specular reflection from the surface. Changes in the positions in the image where points on the surface are shown are not accounted for.
The surface orientation is represented by the normal N to the surface at each point xe2x80x9crxe2x80x9d on the surface. The normal N, as perturbed by the bumps, can be used to compute specular reflection. This reflection is maximal when the normal N coincides with the half angle vector H (the half angle vector H is the unit vector bisecting the angle between the lightsource direction at the point xe2x80x9crxe2x80x9d and the direction from which the point xe2x80x9crxe2x80x9d is viewed.) The further the normal N diverges from the half angle vector H, the more the specular reflection diminishes. This can be modeled using the well known Phong model, by computing the scalar product of the half angle vector H and the perturbed normal and taking the exponent to the power B (B less than 1) of the result.
The computation of the perturbed normal has to be performed very carefully. Overly drastic approximations easily result in artifacts that can be discerned by the human viewer. For example, it is conventional in computer graphics to approximate the surface by a set of abutting flat polygons. If the respective normals to these polygons where used as a starting point for the computation, the human viewer would readily discern the polygons. Therefore, the normal is continuously interpolated over the polygons.
Conventionally, the perturbed normal is determined by computing the coordinates of a number of points on the surface as displaced according to the height field and by computing the normal to a plane fitted through such points. It has been found that this avoids artifacts, but this method is computationally very expensive.
It is also possible to compute the normal locally as a function of the point xe2x80x9crxe2x80x9d, using the spatial derivatives of the height field f(ti,v) and the mapping. Peercy et al. show that the perturbed normal at the point xe2x80x9crxe2x80x9d can be obtained approximately by adding a perturbation vector in a direction perpendicular to the unperturbed normal. This perturbation vector at a point xe2x80x9crxe2x80x9d is a function of the spatial derivative of the height field at the corresponding location in the height field and the spatial derivative of the mapping by which the height field is projected onto the surface at the point xe2x80x9crxe2x80x9d. However, considerable computational effort is needed to determine how this perturbation vector works out for a given position dependent mapping.
It is desirable to simplify this calculation, but again, approximations aimed at simplifying the computation of the perturbation vector easily result in discernable artifacts. For example, it is known to lead to artifacts if one takes each polygon of the set of polygons that is used to approximate the surface, and linearizes the relation between the spatial derivatives of the height field and the perturbation vector in each polygon.
Peercy et al. propose to avoid artifacts and reduce the computational effort by computing the perturbation vector in a tangent coordinate system of the surface. In this coordinate system the unperturbed normal is position independent and the direction of the perturbation vector is independent of the spatial derivative of the mapping. However, in order to compute the scalar product of the perturbed normal and the halfangle vector H, as needed for specular reflection, the halfangle vector H has to be transformed into the tangent coordinate system. This transformation of H depends on the spatial derivatives on the mapping and is computationally expensive.
Again, an approximation using one respective H for each polygon results in discernible artifacts. Therefore, Peercy et al. propose to simplify the determination of H by computing the transformation of H for a limited number of points on the surface and to interpolate H between these points. However, the interpolation of H and the remaining transformations of H still require a considerable amount of computational effort.
It is an object of the invention to reduce this amount of computational effort.
The method according to the invention is characterized in that the direction in which the normal is perturbed in different surface patches, under control of the same location in the bump map is the same direction irrespective of the shape and orientation of each surface patch. Thus, the computational effort needed to transform the perturbation vectors is avoided. Highlight effects due to the shape of the unperturbed surface patch are rendered correctly, but the specular reflection patterns (pattern of highlights) due to the bump map from different surface patches will not correspond to the same height variations. In fact it is even possible that there is no possible height variation that could cause the pattern (this is called an inconsistent pattern). The invention is based on the discovery that human observers experience patterns of highlights due to specular reflection on a rough surface as realistic without being sensitive to the direction and the consistency of such patterns of highlights across the surface. This insensitivity is probably functional to help humans understand surface shape largely independently of lightsource direction.
In addition it has been found that the human observer experiences as realistic an animated sequence of images (time-varying position and orientation of the surface patches) which all use the same direction of perturbations for a time varying surface patch. Hence, no artifacts are experienced even in animation.